package vcp.enums;

import vcp.enums.utility.EnumReverser;
import vcp.enums.utility.EnumReverser.IEnumReverser;

/**
 * 
 * @author VCP team
 *         <p>
 *         site enum class
 *         </p>
 */
public enum SiteEnum implements IEnumReverser
{
	SITE_1 ( "Site 1", 1 ),
	SITE_2 ( "Site 2", 2 ),
	SITE_3 ( "Site 3", 3 ),
	SITE_4 ( "Site 4", 4 ),
	SITE_5 ( "Site 5", 5 ),
	SITE_6 ( "Site 6", 6 );

	private final String name;
	private final int siteID;

	/**
	 * enum class constructor
	 * 
	 * @param name
	 * @param siteID
	 */
	private SiteEnum ( String name, int siteID )
	{
		this.name = name;
		this.siteID = siteID;
	}

	/**
	 * gets site id
	 * 
	 * @return relevant site's id
	 */
	public int getSiteID ()
	{
		return this.siteID;
	}

	@Override
	public String toString ()
	{
		return this.name;
	}

	/**
	 * convert site id to enum per key
	 * 
	 * @param pKey
	 * @return enum
	 */
	public static SiteEnum convert ( String pKey )
	{
		return EnumReverser.convert(SiteEnum.class, pKey);
	}

	/**
	 * 
	 * @author VCP team
	 *         <p>
	 *         enum class for cost update statuses
	 *         </p>
	 */
	public enum SiteCostsUpdateStatus implements IEnumReverser
	{
		APPROVED ( "Approved" ),
		PENDING ( "Pending" ),
		REJECTED ( "Rejected" );

		private final String status;

		/**
		 * constructor
		 * 
		 * @param status
		 */
		private SiteCostsUpdateStatus ( String status )
		{
			this.status = status;
		}

		@Override
		public String toString ()
		{
			return this.status;
		}

		/**
		 * convert to specific enum by key
		 * 
		 * @param pKey
		 * @return enum
		 */
		public static SiteCostsUpdateStatus convert ( String pKey )
		{
			return EnumReverser.convert(SiteCostsUpdateStatus.class, pKey);
		}
	}
}
